import type {RouteLocationNormalized} from "#vue-router";

export default defineNuxtRouteMiddleware((to: RouteLocationNormalized, from: RouteLocationNormalized) => {
    if(import.meta.server)return
    let role: string = roleStore().getRole()
    if (role === '1') {
        return navigateTo('/stroke/driver')
    } else {
        roleStore().setRole('0')
        return navigateTo('/stroke/passenger')
    }
})